<div class="login">
          <div class="wrap">
				<ul class="breadcrumb breadcrumb__t"><a class="home" href="<?php echo base_url(); ?>">Home</a>  / You are logged in as <?php echo $this -> mod_account -> get_logged_in_user_info() -> email; ?> </ul>
				<div class="section group">
					<?php $this -> load -> view(F_MASTER . "dashboard_account"); ?>
				   
				    <div class="cont span_2_of_about">
				    	<h3>Mail boxs (<?php echo $mail_counts; ?>)</h3><a href="<?php echo base_url(); ?>account/compose-mail"><button class="btn btn-primary" style="float: right;"><span class="glyphicon glyphicon-plus"></span> Compose mail to user</button></a>
				    	<div style="clear: both;"></div>
				    	<br />
				    	<table class="table table-bordered">
				    		<tr class="info">
				    		<th>#</th>
				    		<th>Subject</th>
				    		<th>From</th>
				    		<th>From date</th>
				    		<th>Action</th>
				    		</tr>
				    		<?php
				    			if($mail_list->num_rows()>0){
				    					$user_id=$this -> mod_account -> get_logged_in_user_info() -> product_owner_id;
					    				$i=1;
					    			foreach($mail_list->result() as $row){
					    				$mail_id=$row->product_owner_mail_id;
										$subject=$row->subject;
										$send_date=$row->modified_date;
										//$send_to=$row->use_send_to_simple_user_id;
										$send_from=$row->username;
										$mail_status=$row->mail_status;
										$num_reply=($row->numberReply == 1) ? ' ' : "(".$row->numberReply.")";
										
										$is_send_to_deleted=$row->is_send_to_deleted;
										$is_send_from_deleted=$row->is_send_from_deleted;
										
										if($is_send_to_deleted!=$user_id && $is_send_from_deleted!=$user_id){
											$i++;
										
								?>
										<tr <?php echo ($mail_status == 0) ? 'class="warning"' : '' ?>>
							    			<td><?php echo $i; ?></td>
							    			<td><?php echo str_replace("_", " ", $subject) . " " . $num_reply; ?></td>
							    			<td><?php echo $send_from; ?></td>
							    			<td><?php echo $send_date; ?></td>
							    			<td> <a href="<?php echo base_url(); ?>account/view-mail/<?php echo $mail_id; ?>">View Mail</a> | <a href="<?php echo base_url(); ?>account/delete-mail/<?php echo $mail_id; ?>" onclick="return confirm('Are you sure want to delete this mail ?')">Delete</a></td>
							    		</tr>
								<?php
										}
										
										
								
								}
									if($i<=1){
											echo '<tr><td colspan="5">There is no mail user in your mail boxs</td></tr>';
										}
								}else{
								echo '<tr><td colspan="5">There is no mail user in your mail boxs</td></tr>';
								}
				    			?>
				    	</table>  
				    	<h2><?php echo $pagination?></h2>
					</div>
           </div>
		   <div class="clear"></div>	
		  </div>
	</div>	